home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1991 / 06 / alib / strcmpi.asm < prev    next >
Assembly Source File  |  1991-08-21  |  414b  |  32 lines

  1.     include    asm.inc
  2.  
  3.     public    strcmpi
  4.  
  5.     .code
  6.     extn    tolower
  7.  
  8. ;;    strcmpi
  9. ;
  10. ;    entry    DS:SI    string1
  11. ;        ES:DI    string2
  12. ;    exit    Zf    if string1==string2
  13. ;    uses    AX
  14. ;
  15. strcmpi proc
  16.     pushm    di,si
  17. sci1:    mov    ah,es:[di]
  18.     lodsb
  19.     or    ax,ax
  20.     jz    sci2            ;  if same strings
  21.     inc    di
  22.     call    tolower
  23.     xchg    al,ah
  24.     call    tolower
  25.     cmp    ah,al
  26.     je    sci1            ;  if strings match so far
  27. sci2:    popm    si,di
  28.     ret
  29. strcmpi endp
  30.  
  31.     end
  32.